<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <!-- BootStrap css-->
        <link href="<?= base_url('public/css/bootstrap.min.css') ?>" rel="stylesheet" type="text/css">
        <!-- Custom css -->
        <link href="<?= base_url('public/css/admin-style.css') ?>" rel="stylesheet" type="text/css">
        <!-- jquery-->
        <script src="<?= base_url('public/js/jquery-1.9.1.min.js') ?>" type="text/javascript"></script>
        <!-- Bootstrap js -->
        <script src="<?= base_url('public/js/bootstrap.min.js') ?>" type="text/javascript"></script>
        <!-- DataTables js -->
        <script src="<?= base_url('public/js/jquery.dataTables.min.js') ?>" type="text/javascript"></script>
        <script src="<?= base_url('public/js/DT_bootstrap.js') ?>" type="text/javascript"></script>
        <!-- DataTables css -->
        <link href="<?= base_url('public/css/DT_bootstrap.css') ?>" rel="stylesheet" type="text/css">

        <script type="text/javascript">
            $(document).ready(function() {
                $('#tableMessage').dataTable({
                    'bInfo': true, //显示页脚
                    'bFilter': true, //搜索
                    'bSort': false, //排序
                    "bPaginate": true, //分页
                    "bSearchable": true, //参与搜索
                    'bLengthChange': true, //允许改变每页展示数量
                    "bStateSave": true, //用cookies保存上一次关闭页面时的内容
                    "oLanguage": {
                        "sLengthMenu": "每页显示 _MENU_ 条记录",
                        "sZeroRecords": "暂无数据",
                        "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条",
                        "sInfoEmpty": "",
                        "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                        "oPaginate": {
                            "sFirst": "首页",
                            "sPrevious": "<<",
                            "sNext": ">>",
                            "sLast": "尾页"}
                    },
                    "sPaginationType": "bootstrap"
                });
            });
        </script>
    <font style="font-size: 21px">投票结果</font><small class="text-error">(没有票数的不显示)</small>
        <hr>
        <table class="table table-hover" id="tableMessage">
            <thead>
                <tr>
                    <th>学号</th>
                    <th>姓名</th>
                    <th>票数</th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <td><a class="btn btn-primary" href="javascript:history.go(-1);">返回</a></td>
                </tr>
            </tfoot>
            <tbody>
                <?php if (!empty($work)): ?>
                    <?php foreach ($work as $item): ?>
                        <?php
                        if ($item['voteNum'] == 0)
                        {
                            break;
                        }
                        ?>
                        <tr>
                            <td><?= $item['num'] ?></td>
                            <td><?= $item['name'] ?></td>
                            <td><?= $item['voteNum'] ?></td>
                        </tr>
                    <?php endforeach ?>
                <?php endif ?>
            </tbody>
        </table>
    </body>
</html>
